package domain

import (
	"context"

	"gitee.com/mkwchecking/sr-core/config/source"
	"github.com/spf13/cobra"
	"gorm.io/gorm"
)

type IDomain interface {
	Install(ctx context.Context) error
	BeforeStart(src source.ISource) error

	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

type ICmdDomain interface {
	IDomain

	SetupCmd(rootCmd *cobra.Command) error
}

type IHttpDomain interface {
	IDomain

	OnNeedMigrate(db *gorm.DB) error
}
